<?php

/*
  Action	$3

  +2 Actions

  If this is your first Cola you've played this turn +2$, otherwise +1$

 */

class Cola extends Card implements iAction, iKingdom, iAddiction {

    public function __construct() {
        parent::__construct("Cola", 3);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+2 Actions",
            "If this is your first Cola you have played this turn +2$, otherwise +1$");
    }

    public function play(Game $game, $isRealCard) {
        $game->addActions(2);
        $playArea = $game->getPlayArea();
        $colas = 0;
        foreach ($playArea as $card) {
            if ($card instanceof Cola) {
                $colas +=1;
            }
        }
        $coins = 1;
        if ($colas == 1) {
            $coins = 2;
        }
        $game->addMoney(new Price($coins));

        ScreenDisplay::addScreenMessage($game, true, "get +2 actions and " . $coins . "$ ", "gets +2 actions and " . $coins . "$");
        $game->cardActionFinished();
        return true;
    }

}

?>